<template>
  <div class="wrapper">
    <div class="content">
      <span class="value">{{ value }}</span>
      <span class="unit">{{ unit }}</span>
    </div>
    <div v-if="icon" class="img">
      <img :src="icon" alt="" style="width: 100%" />
    </div>
  </div>
</template>

<script>
export default {
  name: "NumberUnitImg",
  props: {
    icon: String,
    value: String,
    unit: {
      type: String,
      default: "个",
    },
  },
};
</script>

<style lang="scss" scoped>
.wrapper {
  display: grid;
  place-content: center;
  grid-template-rows: 20px 62px;
  grid-row-gap: 5px;
  .content {
    color: #fff;
    text-align: center;
  }
  .value {
    font-size: 24px;
    font-weight: bold;
    color: #26dffe;
    line-height: 24px;
  }
  .unit {
    font-size: 17px;
  }
}
</style>
